// 汽车充电桩相关请求
import request from '../request.js';
import {
	getChargeStationURL,
	updateChargeOrderURL,
	getChargeStationDeatailURL,
	getchargejudementURL,
	getnavigationURL,
	addChargeOrderURL
} from "../urls.js"
export default {
	// 获取周边充电桩
	getAroundCharge(data) {
		return request({
			url: getChargeStationURL,
			method: 'get',
			data
		})
	},
	// 获取充电桩详情
	getChargeDetail(data) {
		return request({
			url: getChargeStationDeatailURL,
			method: 'get',
			data
		})
	},
	//获取单个充电桩评价
	getchargejudement(data) {
		return request({
			url: getchargejudementURL,
			method: 'get',
			data
		})
	},
	//规划路线
	getpath(data) {
		return request({
			url: getnavigationURL,
			method: 'get',
			data
		})
	},
	// 生成充电订单
	addChargeOrder(data) {
		return request({
			url: addChargeOrderURL,
			method: 'post',
			data
		})
	},
	//充电结束生成充电订单
	addnewChargeOrder(data) {
		return request({
			url: updateChargeOrderURL + '?code=' + data.code + '&userId' + data.userId + '&totalDegree' + data
				.totalDegree + '&remark' + data.remark,
			method: 'put',
			// data
		})
	}

}
